package com.h3c.nem.dto.enums;

import lombok.Getter;

@Getter
public enum UserRoleEnum {

//    //用户角色
//    public static final int USER_ROLE_ADMIN = 1;//管理员
//    public static final int USER_ROLE_BP = 2;//HRBP
//    public static final int USER_ROLE_DEPT_CONTACTOR = 3;//部门接口人
//    public static final int USER_ROLE_DEPT_MANAGER = 4;//部门主管
//    public static final int USER_ROLE_WORKER = 5;//新员工
//    public static final int USER_ROLE_APPROVER = 6;//流程审批人
//    public static final int USER_ROLE_DIRECT_MANAGER = 7;//直接主管
//    public static final int USER_ROLE_GBBZ = 8;//干部部长
//    public static final int USER_ROLE_TASK_MANAGER=9;//小任务管理员
//    public static final int USER_ROLE_TEACHER_MANAGER=10;//允许管理导师的HB和gbbz
    ADMIN("管理员", "1"),
    BP("HRBP", "2"),
    CONTACTOR("部门接口人", "3"),
    DEPT_MANAGER("部门主管", "4"),
    WORKER("新员工", "5"),
    APPROVER("流程审批人","6"),
    DIRECT_MANAGER("直接主管", "7"),
    GBBZ("干部部长", "8"),
    TASK_MANAGER("小任务管理员", "9"),
    TEACHER_MANAGER("允许管理导师的HB和gbbz", "10"),
    CHRO("CHRO", "11"),
    OFFICE_SSC_MANAGER("入职审核ssc管理员", "12"),
    OFFER_DEPT_MANAGER("入职审核部门管理员", "13"),
    NEW_WORKER_BP("新员工bp", "14"),
    OFFER_BP("入职期bp", "15"),
    CARD_DEPT("卡证科管理员", "16"),
    SEND_OFFER("允许发送offer", "17"),
    TEACHER("导师", "18"),
    DEPT1BP("一级部门Bp", "19"),
    RECRUITMENT("招聘调配部管理员", "20"),
    SS_MANAGER("社保管理员", "21");


    final private String roleName;
    final private Short roleCode;

    UserRoleEnum(String roleName, String roleCode) {
        this.roleName = roleName;
        this.roleCode = Short.parseShort(roleCode);
    }


    public static String getNameByCode(Short roleCode) {

        for (UserRoleEnum userRole : UserRoleEnum.values()) {
            if (userRole.getRoleCode().equals(roleCode)) {
                return userRole.getRoleName();
            }
        }
        return null;
    }



}
